package task;

import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;

import database.Database;

public class taskCheck {
	
	public static boolean CheckUsr(int taskid, int usrid) throws SQLException
	{
		Connection conn = Database.getConnection();
		Statement stmt = conn.createStatement();
		ResultSet rs = stmt.executeQuery("select id from task " +
				"where usr = '" + usrid + "' and id = '" + taskid +"'");
		
		
		if( rs.next() ) {
			stmt.close();
			conn.close();
			return true;
		} else {
			stmt.close();
			conn.close();

			return false;
		}
	}
}
